namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string mergeResult = string.Empty;
        string content1 = string.Empty;
        string content2 = string.Empty;
        private void button1_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFile = new OpenFileDialog())
            {
                openFile.InitialDirectory = "c:\\";

                if (openFile.ShowDialog() == DialogResult.OK)
                {
                    var fs = openFile.OpenFile();

                    using (StreamReader sr = new StreamReader(fs))
                    {
                        content1 = sr.ReadToEnd();
                    }
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFile = new OpenFileDialog())
            {
                openFile.InitialDirectory = "c:\\";

                if (openFile.ShowDialog() == DialogResult.OK)
                {
                    var fs = openFile.OpenFile();

                    using (StreamReader sr = new StreamReader(fs))
                    {
                        content2 = sr.ReadToEnd();
                    }
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            using (StreamWriter sw = new StreamWriter("Data\\result.txt"))
            {
                sw.Write(content1 + "\n" + content2);
            }
        }
    }
}